Reading Modules from SkipList without visually opening the module

Here's what I got:
 

Object currObj = current
Skip SkipMod = createString()
ModName_ oModRef
 
for oModRef in currObj<-"*" do
{
    string oModName = name(oModRef)
        string linkModNameWithPath = path(oModRef) "/" oModName
        put(SkipMod, linkModNameWithPath, "")
}
for e in SkipMod do
{
        Module m = read(string key SkipMod, false)
}

 


I obtain my desired results (code is drastically simplified), but when the module is "read", it is physically opened on my desktop. How can I stop it from opening on my desktop?

 


moheganburnerIII - Thu Oct 06 22:39:32 EDT 2011

Re: Reading Modules from SkipList without visually opening the module
Mathias Mamsch - Fri Oct 07 00:35:20 EDT 2011

I am not sure what you mean with 'physically opening' a module, but if you are asking 'How can I read a module without opening it?' then the answer is you can't. Basically it works like a book. Cannot read it without opening it. :-)

Since you already have the 'false' parameter in your 'read' call, the module should open invisibly. What is the problem with opening the module? What are you trying to do? There are in fact some things that you can do without opening the module, e.g. query a module attribute or rename it.

Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Reading Modules from SkipList without visually opening the module
moheganburnerIII - Fri Oct 07 10:12:02 EDT 2011

Well, previously I was using a string array:

string s[] = "/folderpath/module1 name", "/folderpath"module2 name"}
for i in 0:1 do
{
    Module m = read(s[i], false)
}


The above would read modules invisibly. But since I don't know how many modules I would need to open, I switched to a skip list via:

 

Skip s = createString()
put(s, /folderpath/module1 name, "")
put(s, /folderpath/module2 name, "")
 
for e in s do
{
    Module m = read(string key s, false)
}



Basically, the string array would READ modules invisibly, but the skiplist actually opens them. Functionally they are the same, but it would be nice to use the skip list method without having 40 modules open and close themselves. Any thoughts?



 

Re: Reading Modules from SkipList without visually opening the module
llandale - Fri Oct 07 13:50:54 EDT 2011

Try fullName(m) instead of path(m) "/" name(m).

I'm a little ignorant on this 'casting' stuff, but try changing this:
... Module m = read(string key SkipMod, false)
to this:
... string NameMod = (string key SkipMod)
... read(NameMod, false)

I think the syntax of the "key" command requires the parentheis around the 3 words each time, and you might as well just do that since it makes the code easier to read.

  • Louie

You could of course also do this:
... put(SkipMod, linkModNameWithPath, linkModNameWithPath)
for NameMod in SkipMod do
{ Module m = read(NameMod, false)
}

And of course routinely load the standard view since you rarely care what view is loaded and want to avoid firing off attr DXL bla bla bla:
.. Module m = read(NameMod, false, true)

Re: Reading Modules from SkipList without visually opening the module
moheganburnerIII - Fri Oct 07 16:05:01 EDT 2011

Thanks Louie. That works perfectly.

Re: Reading Modules from SkipList without visually opening the module
Mathias Mamsch - Fri Oct 07 16:48:28 EDT 2011

moheganburnerIII - Fri Oct 07 16:05:01 EDT 2011
Thanks Louie. That works perfectly.

Are you saying that putting it in Louie's syntax stopped the modules from being opening visibly? I don't get it ... Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Reading Modules from SkipList without visually opening the module
moheganburnerIII - Sun Oct 09 14:41:31 EDT 2011

Mathias Mamsch - Fri Oct 07 16:48:28 EDT 2011
Are you saying that putting it in Louie's syntax stopped the modules from being opening visibly? I don't get it ... Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Yes, exactly!

The way I see it either 1) declaring something a "Module" (as I did with "Module m =") or 2) reading a module path from a skip key (as I did with "string key s"), is why it reads visibly.

Normally, I'd test myself to find out exactly which part was making it do what it did, but I ran outta time Friday. I'll test on Monday and will post back for closure.

Oh, and I use 9.2.

Re: Reading Modules from SkipList without visually opening the module
moheganburnerIII - Sun Oct 09 14:49:43 EDT 2011

Scratch that. When I was using the string array method, I was using "Module m =", and that definitely read the modules invisibly. So I guess the reason must be that I was calling the path via "string key SkipMod". I don't get it either. In my eyes

Module m = read(string key SkipMod, false)


is the exact same as

 

string NameMod = (string key SkipMod)
Module m = read(NameMod, false)


Maybe its a parenthetical thing like he said in his post. Where's the scratches his head emoticon when you need it.

 

Re: Reading Modules from SkipList without visually opening the module
llandale - Sun Oct 09 15:24:44 EDT 2011

moheganburnerIII - Sun Oct 09 14:49:43 EDT 2011

Scratch that. When I was using the string array method, I was using "Module m =", and that definitely read the modules invisibly. So I guess the reason must be that I was calling the path via "string key SkipMod". I don't get it either. In my eyes

Module m = read(string key SkipMod, false)


is the exact same as

 

string NameMod = (string key SkipMod)
Module m = read(NameMod, false)


Maybe its a parenthetical thing like he said in his post. Where's the scratches his head emoticon when you need it.

 

Skip SkipMod = createString()
put(SkipMod, "/Testing/CreateObject", "/Testing/CreateObject")
 
string Data
for Data in SkipMod do
{  Module m = read(string key SkipMod, false)  // << Original Syntax
}


The first time I ran the above I got "invalid use of identifier false" at line 6. Thereafter, the code interpreted but the module opened visibly.

Change that line to this and the module opens invisibly:
{ Module m = read((string key SkipMod), false) // << Suggested Syntax

So I conclude, for reason's I don't understand, that the casting of the "key" command must be all 3 words surrounded with parenthesis. Asking "why" doesn't help! But I'm guessing the "false" is getting interpreted along with the "key" commnand, which is then cast as "string".

 

 

  • Louie


I think the real reason for this is the same reason that hot dogs come in packs of 10 yet hot dog buns come in packs of 8.